home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
ADB.a
next >
Wrap
Text File
|
1996-05-01
|
5KB
|
174 lines
;
; File: ADB.a
;
; Contains: ADB Interface for System 8
;
; Version: Technology:
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__ADB__') = 'UNDEFINED' THEN
__ADB__ SET 1
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF &TYPE('__IOITERATOR__') = 'UNDEFINED' THEN
include 'IOIterator.a'
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
;
;------------------------------------------------------------------------------------
; Types
;------------------------------------------------------------------------------------
;
kADBCurrentIteratorDescVersion EQU 1
ADBIOIteratorData RECORD 0
IOCI ds IOCommonInfo ; offset: $0 (0) ; common data for all families
currentAddress ds.b 1 ; offset: $14 (20)
defaultAddress ds.b 1 ; offset: $15 (21)
defaultHandlerID ds.b 1 ; offset: $16 (22)
ORG 24
sizeof EQU * ; size: $18 (24)
ENDR
; typedef UInt32 ADBConnectionID
ADBRegisterContents RECORD 0
data ds.b 8 ; offset: $0 (0)
length ds.l 1 ; offset: $8 (8)
sizeof EQU * ; size: $C (12)
ENDR
;
;------------------------------------------------------------------------------------
; Calls
;------------------------------------------------------------------------------------
;
;
; extern OSStatus ADBGetDeviceData(ItemCount requestCount, ItemCount *totalCount, ADBIOIteratorData *deviceData)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBGetDeviceData
ENDIF
;
; extern OSStatus ADBOpen(const IODeviceRef *ref, ADBConnectionID *connection)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBOpen
ENDIF
;
; extern OSStatus ADBClose(ADBConnectionID connection)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBClose
ENDIF
;
; extern OSStatus ADBGetNextAutopoll(ADBConnectionID connection, Duration timeOut, ADBRegisterContents *contents, AbsoluteTime *timestamp)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBGetNextAutopoll
ENDIF
; ADBGetRegister sends a Talk command over the wire
;
; extern OSStatus ADBGetRegister(ADBConnectionID connection, Byte registerNumber, ADBRegisterContents *contents, AbsoluteTime *timestamp)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBGetRegister
ENDIF
;
; ADBSetRegister sends a Listen command over the wire
; Note, only allowed for registers 0, 1, and 2
; Use the specific calls to set individual fields of register 3
;
;
; extern OSStatus ADBSetRegister(ADBConnectionID connection, Byte registerNumber, const ADBRegisterContents *contents)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBSetRegister
ENDIF
;
; extern OSStatus ADBGetHandlerID(ADBConnectionID connection, Byte *handlerID)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBGetHandlerID
ENDIF
;
; extern OSStatus ADBSetHandlerID(ADBConnectionID connection, Byte handlerID)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBSetHandlerID
ENDIF
;
; for ADBGetStatusBits and ADBSetStatusBits,
; the 4 most significant bits of the bits parameter
; contain the 4 most significant bits of the first byte of device register 3
;
;
; extern OSStatus ADBGetStatusBits(ADBConnectionID connection, Byte *bits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBGetStatusBits
ENDIF
;
; extern OSStatus ADBSetStatusBits(ADBConnectionID connection, Byte bits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBSetStatusBits
ENDIF
; see the Guide to Macintosh Family Hardware for more info on an ADB device activator
;
; extern OSStatus ADBTestActivator(ADBConnectionID connection, Boolean *activatorPressed)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBTestActivator
ENDIF
;
; extern OSStatus ADBFlush(ADBConnectionID connection)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBFlush
ENDIF
;
; extern OSStatus ADBResetBus(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ADBResetBus
ENDIF
;
;------------------------------------------------------------------------------------
; status codes
;------------------------------------------------------------------------------------
;
; ADB assigned range is -30279 to -30260 inclusive
adbDeviceBusyErr EQU -30279 ; device already Opened
adbInvalidConnectionIDErr EQU -30278
adbConnectionTerminatedErr EQU -30277 ; device closed or unplugged during the call
adbDeviceTimeoutErr EQU -30276
adbReservedHandlerIDErr EQU -30275
adbInvalidHandlerIDErr EQU -30274
ENDIF
ENDIF ; __ADB__